package md.mru.backend.core.repositories;

import md.mru.backend.core.domains.Contract;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author sergiu.marin
 * @since 01.04.2014
 */
public interface ContractRepository extends JpaRepository<Contract, Long> {

    @Query("SELECT c FROM Contract c WHERE c.folder = :folderId")
    List<Contract> getContracts(@Param("folderId") Long folderId);

}
